import com.wxc.list.AbsList;
import org.junit.Test;

/**
 * @program: LoveDataStructures1
 * @description: 动态数组
 * @author: wxc
 * @create: 2021-04-03 15:02
 **/
public class Main {
    public static void main(String[] args) {
        AbsList<Integer> myArray = new MyArray<>();
        myArray.add(11);
        myArray.add(12);
        myArray.add(13);
        myArray.add(14);
        myArray.add(14);
        myArray.clear();
        myArray.add(14);
        myArray.add(14);
        myArray.add(14);
        myArray.remove(0);
        myArray.add(0,18);
        System.out.println(myArray.toString());
//        System.out.println(myArray.get(1));
    }

    @Test
    public void test1(){
        MyArray<Person> myArray = new MyArray<>();
        myArray.add(new Person("xiaomi",12));
        myArray.add(new Person("xiaomi",12));
//        myArray.add(new Person("xiaomi",12));
//        myArray.add(new Person("xiaomi",12));
//        myArray.add(new Person("xiaomi",12));
        System.out.println(myArray.indexOf(new Person("xiaomi", 13)));
        System.out.println(myArray.toString());
    }

    @Test
    public void test2(){
        Person p1 = new Person("xiaomi", 12);
        Person p2 = new Person("xiaomi", 13);
        System.out.println(p1.equals(p2));
    }
}
